package com.jimmy.aop;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @version 1.0
 * @ ClassName AopApp
 * <p> TODO
 * @ author JIMMY
 * @ Date 2020/10/25 0025 上午 11:08
 */
public class AopApp {
    public static void main(String[] args) {
//        test1();
//        test2();
        test3();
    }
    public static void  test1(){
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext4.xml");
        UserDao userDao = (UserDao) ctx.getBean("userDao");
        userDao.save();
    }
    public static void  test2(){
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext5.xml");
        UserDao userDao = (UserDao) ctx.getBean("userDao");
        userDao.saveArgs(1,"jimmy");
    }
    public static void  test3(){
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext6.xml");
        UserDao userDao = (UserDao) ctx.getBean("userDao");
        userDao.saveReturn(1,"jimmy");
    }
}
